/*
 * @Author: wangtao
 * @Date: 2020-08-20 14:07:42
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-06-07 14:03:32
 * @Description:
 */

import React from 'react';
import {
  View,
  StyleSheet,
  Image,
  Text,
  TouchableOpacity
} from 'react-native';
import {
  empty04,
  iconRefreshBlack,
} from '@/images';
import {
  px2dp,
  fontColorBlack,
  fontColorDeepGray,
  mainBgColorWhite
} from '@/styles';
import { msg } from '@/common';

export default class DriverUnTruck extends React.PureComponent {
  render() {
    return (
      <View style={styles.unCerContainer}>
        <Image source={empty04} resizeMode='stretch' style={styles.img} />
        {/* <Text  style={styles.title}>您没有车辆，无法接单</Text> */}
        {/* <Text  style={styles.desc}>请联系车主为您分配车辆</Text> */}
        <Text style={styles.desc}>您没有车辆，无法接单</Text>
        <TouchableOpacity
          style={styles.refreshBtn}
          activeOpacity={0.8}
          onPress={() => {
            msg.emit('router: refreshRoute', {
              routeName: 'DriverTab',
            });
          }}
        >
          <Text style={styles.refreshText}>刷新页面</Text>
          <Image source={iconRefreshBlack} resizeMode='stretch' style={styles.refreshImg} />
        </TouchableOpacity>
        {/* <Submit
          text="添加车辆"
          onClick={() => {
            // CarDetail
            msg.emit('router: goToNext', {routeName: 'CarDetail'});
          }}
          boxStyle={{
            width: px2dp(216),
            height: px2dp(72),
            borderWidth: 1,
            borderColor: fontColorCoffee,
            borderRadius: px2dp(8),
          }}
          btnTextStyle={{
            fontSize: px2dp(32),
          }}
        /> */}
      </View>
    );
  }
}

const styles = StyleSheet.create({
  unCerContainer: {
    flex: 1,
    alignItems: 'center',
    paddingHorizontal: px2dp(75),
    paddingTop: px2dp(140)
  },
  img: {
    width: px2dp(240),
    height: px2dp(240)
  },
  title: {
    fontSize: px2dp(34),
    color: fontColorBlack,
    fontWeight: 'bold',
    marginTop: px2dp(48),
    marginBottom: px2dp(16),

  },
  desc: {
    fontSize: px2dp(28),
    lineHeight: px2dp(36),
    color: fontColorDeepGray,
    textAlign: 'center',
    marginBottom: px2dp(56),
    marginTop: px2dp(48),
  },
  refreshBtn: {
    width: px2dp(240),
    height: px2dp(80),
    backgroundColor: mainBgColorWhite,
    borderRadius: px2dp(40),
    flexDirection: 'row',
    alignItems: 'center',
    justifyContent: 'center'
  },
  refreshText: {
    fontSize: px2dp(28),
    color: fontColorDeepGray
  },
  refreshImg: {
    width: px2dp(28),
    height: px2dp(28),
    marginLeft: px2dp(12)
  }
});
